import React, { Component } from 'react';
//引入公共的JS文件
import {glabalContext} from "./common/js/globalData"
const {Consumer} = glabalContext
class Childpraen_B extends Component{
    render(){
        return(
            <div>
                {/* 孙子组件也需要读取父父组件role数据 */}
                <div>
                    <h1>这是Child1的子组件，孙子组件</h1>
                    <Consumer>
                        {
                            value=>(
                                <div>
                                    {value.role}
                                </div>
                            )
                        }
                    </Consumer>
                </div>
            </div>
        )
    }
}
export default Childpraen_B